#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2025 粤港澳大湾区（广东）国创中心

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

File: pyncti_create_box.py
Desc: Function to create a box based on user-defined parameters.
Author: xumanjia
Date: 2025-08-01
"""
# 根据用户提供的长方体长、宽、高等参数创建一个长方体

def pyncti_create_box(NCTI,doc):
    doc.ResetCaseResult()
    length = 10.0
    width = 20.0
    height = 30.0
    pt = NCTI.Point(0, 0, 0)

    res = doc.ReturnDialogData(-1, "创建长方体参数", "长", length, "宽", width, "高", height, "顶点坐标", pt)
    if len(res) == 0 : 
        print("用户取消了操作")
    elif res[0] <= 0.0 or res[1] <= 0.0 or res[2] <= 0.0 :
        print("请输入合理的长方体的长、宽和高")
    else :
        length = res[0]
        width = res[1]
        height = res[2]
        pt = res[3]
        doc.RunCommand("cmd_ncti_create_box", "", pt, length, width, height)

            


